package com.hsgene.discount.constants;

/**
 * @Description: //使用目标类型
 * @ProjectName: hdas-geneshop-server
 * @Package: com.hsgene.discount.constants
 * @Author: FX
 * @CreateDate: 2018/11/26 17:47
 * @Version: 1.0
 * Copyright: Copyright (c) 2018
 */
public enum UseTargetType {
    /**
     * 全平台商品
     */
    FULL_PLATFORM_GOODS(1,"全平台商品"),
    UNDEFINED(-1, "未定义的类型");
    /**
     * 编码
     */
    private final int code;

    /**
     * 描述
     */
    private final String desc;

    public static UseTargetType getEnum(int code) {
        for (UseTargetType type : values()) {
            if (type.code==code) {
                return type;
            }
        }
        return UNDEFINED;
    }

    UseTargetType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
